<?php
  class View{
    private $viewName;
    private $user;
    private $folder;
    
    private function renderTplPart($name)
    {
      include __DIR__.'/../../views/layout/'.$name.'.viewpart.php';
    }
    public function set_tpl($name)
    {
      $this->viewName = $name;
    }
    public function set_user(UserModel $user){
      $this->user = $user;
    }
    public function set_folder($name)
    {
      $this->folder = strtolower($name);
    }
    public function render(){
      $this->renderTplPart('Start');
      $this->renderTplPart('Header');
      include __DIR__.'/../../views/'. $this->folder . '/' . $this->viewName . '.view.php';
      $this->renderTplPart('End');
    }
  }
?>